<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/inc/taglib.inc"%>
<%@ include file="/WEB-INF/inc/script.inc"%>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="${base}">
<title>中金通 | 线下支付订单审核</title>

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">

<!-- FooTable -->
<!-- <link href="css/plugins/footable/footable.core.css" rel="stylesheet"> -->
<!-- Data Tables -->
<link href="css/plugins/dataTables/dataTables.bootstrap.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.responsive.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.tableTools.min.css"
	rel="stylesheet">
<link href="css/plugins/jsTree/style.min.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- Sweet Alert -->
<link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">
<link href="js/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet">
<link href="css/plugins/blueimp/css/blueimp-gallery.min1.css" rel="stylesheet">
<style type="text/css">
	.form-control[readonly]{
		background-color: #fff;
		opacity: 1;
	}
	.blueimp-gallery {
        overflow: hidden;
		z-index: 999999;
		background: #000;
		background: rgba(0, 0, 0, 0.9);
		display: none;
		direction: ltr;
		-ms-touch-action: none;
		touch-action: none;
    }
    .blueimp-gallery>.slides {
		position: relative;
		height: 100%;
		overflow-x: hidden
	}
	.blueimp-gallery>.slides>.slide {
		position: relative;
		float: left;
		margin-top:15px;
		height: 90%;
		text-align: center;
		-webkit-transition-timing-function: cubic-bezier(0.645,.045,.355,1);
		-moz-transition-timing-function: cubic-bezier(0.645,.045,.355,1);
		-ms-transition-timing-function: cubic-bezier(0.645,.045,.355,1);
		-o-transition-timing-function: cubic-bezier(0.645,.045,.355,1);
		transition-timing-function: cubic-bezier(0.645,.045,.355,1)
	}
	textarea{
		resize:none;
	}
</style>
</head>

<body>

	<div id="wrapper" style="position:relative;">
		<div id="blueimp-gallery" class="blueimp-gallery">
             <div class="slides"></div>
             <h3 class="title"></h3>
			 <a class="prev">‹</a>
             <a class="next">›</a>
             <a class="close">×</a>
        </div>
		<!-- 左侧菜单 -->
		<jsp:include page="/WEB-INF/jsp/common/main-menu.jsp"></jsp:include>
		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom">
				<!-- 头部工具栏区 -->
				<jsp:include page="/WEB-INF/jsp/common/main-header.jsp"></jsp:include>
			</div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<h2>财务管理</h2>
					<ol class="breadcrumb">
						<li><a href="common/platform">Home</a></li>
						<li><a href="orderAudit/list">订单审核</a></li>
						<li class="active"><strong>线下审核订单</strong></li>
					</ol>
				</div>
				<div class="col-lg-2"></div>
			</div>
			<input type="text" id="org_id" class="hidden" value="${sessionScope.security_context_user.orgId}"/>
			<div class="row" style="margin-top: 10px;">
				<div class="col-md-12">
					<div class="tabs-container">
					<ul class="nav nav-tabs">
                            <li class="active">
								<a href="orderAudit/list">
									 线下审核订单
								</a>
							</li>
<!-- 							<li> -->
<!-- 								<a href="orders/entering"> -->
<!-- 									 线下订单录入 -->
<!-- 								</a> -->
<!-- 							</li> -->
                        </ul>
						<div class="tab-content">
							<div class="tab-pane active">
								<div class="panel-body">
									<div
										class="wrapper wrapper-content animated fadeInRight ecommerce">
<!-- 											<div class="ibox-title hidden">
												<h5>查询条件</h5>
												<div class="ibox-tools">
													<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
													</a>
												</div>
											</div> -->
											<div class="ibox-content m-b-sm">
												<form id="queryForm" method="post">
													<div class="row">
														<div class="col-sm-4">
															<div class="form-group">
																<label class="control-label" for="orderId">订单编号</label>
																<input type="text" id="orderId" name="orderId" value=""
																	placeholder="订单编号" class="form-control">
															</div>
														</div>
														<div class="col-sm-4">
															<div class="form-group">
																<label class="control-label" for="date_added">下单时间</label>
																<div class="input-group date">
																	<span class="input-group-addon"><i
																		class="fa fa-calendar"></i></span><input name="orderTimeStart" id="orderTimeStart"
																		placeholder="" type="text" class="form-control" value="" readonly="readonly">
																</div>
															</div>
														</div>
														<div class="col-sm-4">
															<label class="control-label" for="date_added">&nbsp;</label>
															<div class="form-group">
																<div class="input-group date">
																	<span class="input-group-addon">至<i
																		class="fa fa-calendar"></i></span><input name="orderTimeEnd" id="orderTimeEnd"
																		placeholder="" type="text" class="form-control" value="" readonly="readonly">
																</div>
															</div>
														</div>
													</div>
													<div class="row">
														<div class="col-sm-4">
															<div class="form-group">
																<label class="control-label" for="investorName">投资人姓名</label> <input
																	type="text" id="investorName" name="investorName" value=""
																	placeholder="投资人姓名" class="ui-autocomplete-input form-control" autocomplete="off">
															</div>
														</div>
														<div class="col-sm-4">
															<div class="form-group">
																<label class="control-label" for="investorMobile">投资人电话</label>
																<input type="text" id="mobile" name="investorMobile" value=""
																	placeholder="投资人电话" class="form-control">
															</div>
														</div>
														<div class="col-sm-4">
															<div class="form-group">
																<label class="control-label" for="auditState">审核状态</label>
																	<select id="auditState" name="auditState" 
																		class="form-control m-b" tabindex="2">
																		<option value="" selected="selected">所有</option>
																		<option value="1">未审核</option>
																		<option value="2">审核未通过</option>
																		<option value="3">审核已通过</option>
																	</select>
															</div>
														</div>
													</div>
													<div class="row">
														<div class="col-sm-4 col-sm-offset-5">
					                                        <button class="btn btn-primary" id="queryBtn" type="button">查询</button>
					                                        <button class="btn btn-outline btn-default" id="cancelQuery" type="reset">重置</button>
					                                        <button class="btn btn-primary" id="exportExcel" type="button">导出Excel</button>
					                                    </div>
													</div>
												</form>
											</div>
										<div class="row">
											<div class="col-lg-12">
												<div class="ibox float-e-margins">
													<div class="ibox-content">
														<table id="ordersEditable"
															class="table table-striped table-bordered table-hover">
															<thead>
																<tr>
																	<th>订单编号</th>
																	<th>投资人</th>
																	<th>产品</th>
																	<th>认购金额</th>
																	<th>下单时间</th>
																	<th>审核状态</th>
																	<th style="background-color: white;">操作</th>
																</tr>
															</thead>
															<tbody>
															</tbody>

														</table>

													</div>
												</div>
											</div>
										</div>

									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- audit list start -->
				<div class="modal inmodal fade" id="auditListModel" tabindex="-1" role="dialog"  aria-hidden="true">
                                <div class="modal-dialog modal-lg">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                            <h4 class="modal-title">审核列表</h4>
                                        </div>
                                        <div class="modal-body">
                                        <div id="auditListBody"></div>
										<script id="auditListTemplate" type="text/x-jquery-tmpl">
                               			<table id="ordersEditable"
															class="table table-striped table-bordered table-hover">
															<thead>
																<tr>
																	<th>审核人</th>
																	<th>审核时间</th>
																	<th>审核意见</th>
																	<th>是否审核通过</th>
																</tr>
															</thead>
															<tbody>
															{{each(i,record) auditList}}
															<tr><td>{{= record.employeeName}}</td><td>{{= record.auditTime}}</td>
															<td>{{= record.remark}}</td><td>{{if record.pass == true}}是{{else}}否{{/if}}</td>
															</tr>
															{{/each}}
															</tbody>

														</table>
										</script>
                                        </div>
                                        <div class="modal-footer">
                                        	<div class="col-sm-5 col-sm-offset-2">
                                            	<button type="button" class="btn btn-primary" data-dismiss="modal">确 定</button>
                                        	</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- audit list end -->
            	<!-- audit start -->
				<div class="modal inmodal fade" id="auditModel" tabindex="-1" role="dialog"  aria-hidden="true">
                                <div class="modal-dialog modal-lg">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                            <h4 class="modal-title">订单审核</h4>
                                        </div>
                                        <div class="modal-body">
                                        <div id="auditBody"></div>
										<script id="auditTemplate" type="text/x-jquery-tmpl">
                               			<form id="auditForm" method="post">
							                <div class="row">
												<input type="text" style="display:none;" id="orderAuditId" name="orderId" value={{= orderId}}>
								                {{if voucherCount}}
                                                <div class="col-sm-3">
													<label class="control-label" for="brief_name">线下打款凭证</label>
								                </div>
                                                <div class="col-md-6">
										            <div class="lightBoxGallery">
                                                       {{each(i,voucher) voucherList}}
                                                         <a href="{{= voucher.filePath}}" title="凭证{{= i+1}}" data-gallery=""><img style="width:100px;height:100px;" src="{{= voucher.filePath}}"></a> &nbsp;&nbsp;&nbsp;
                                                       {{/each}}
                        				             </div>
								                </div>
								                {{else}}{{/if}}
							                </div>
											<div class="row">
							                    <div class="col-sm-12">
							                        <div class="form-group">
							                            <label class="control-label" for="brief_name">审核意见</label>
							                            <textarea name="remark" rowspan="3" class="form-control"></textarea>
							                        </div>
							                    </div>
											</div>
											<div class="row">
							                    <div class="col-sm-12">
							                        <div class="form-group">
							                            <label class="control-label" for="state">是否审核通过</label>
							                            <select class="form-control m-b" name="pass" >
							                                <option value="1">是</option>
							                                <option value="0">否</option>
							                            </select>
							                        </div>
							                    </div>
							                </div>
							                <div class="row">
							                	<div class="form-group">
							                         <div class="col-sm-4 col-sm-offset-5">
							                             <button class="btn btn-primary" id="auditBtn" type="button">确 定</button>
							                             <button class="btn btn-white" data-dismiss="modal" type="button">取 消</button>
							                         </div>
							                    </div>
							                </div>
										</form>
										</script>
                                        </div>
                                    </div>
                                </div>
                            </div>
            <!-- audit end -->
			<!-- 底部版权 -->
			<jsp:include page="/WEB-INF/jsp/common/main-footer.jsp"></jsp:include>
		</div>

	</div>



	<!-- Mainly scripts -->
	<script src="js/jquery-2.1.1.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="js/plugins/jeditable/jquery.jeditable.js"></script>
	<script src="js/jquery.serialize-object.min.js" type="text/javascript"></script>
	<script src="js/plugins/jquery-ui/jquery-ui.min.js"></script>

	<!-- Data Tables -->
	<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="js/plugins/dataTables/dataTables.responsive.js"></script>
	<script src="js/plugins/dataTables/dataTables.tableTools.min.js"></script>

	<!-- Custom and plugin javascript -->
	<script src="js/inspinia.js"></script>
	<script src="js/plugins/pace/pace.min.js"></script>
	<script src="js/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>

	<!-- Data picker -->
	<script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<!-- Sweet alert -->
    <script src="js/plugins/sweetalert/sweetalert.min.js"></script>
    <!-- blueimp gallery -->
    <script src="js/plugins/blueimp/jquery.blueimp-gallery.min1.js"></script>
	<!-- Page-Level Scripts -->
	<script src="js/jquery.tmpl.min.js"></script>
	<script src="js/orderAudit/orderAudit-module.js?v=${jsVersion}"></script>
	
	<script>
		$(document).ready(function() {
			OrderAuditModule.init();
			$('#orderTimeStart').datepicker({
				todayBtn : "linked",
				keyboardNavigation : true,
				forceParse : false,
				calendarWeeks : true,
				autoclose : true,
				format: "yyyy-mm-dd",
				language: 'cn',
			});
			
			$('#orderTimeEnd').datepicker({
				todayBtn : "linked",
				keyboardNavigation : true,
				forceParse : false,
				calendarWeeks : true,
				autoclose : true,
				format: "yyyy-mm-dd",
				language: 'cn',
			});
		});
	</script>

</body>

</html>
